// uvm_tb/agent/binary_alu_agent.sv
`ifndef BINARY_ALU_AGENT_SV
`define BINARY_ALU_AGENT_SV


class binary_alu_agent extends uvm_agent;

    // ========================================================================
    // Data Members
    // ========================================================================
    binary_alu_driver m_driver;
    binary_alu_monitor m_monitor;
    uvm_sequencer #(binary_alu_transaction) m_sequencer;

    // ========================================================================
    // UVM Macros
    // ========================================================================
    `uvm_component_utils(binary_alu_agent)

    // ========================================================================
    // Constructor
    // ========================================================================
    function new(string name, uvm_component parent);
        super.new(name, parent);
    endfunction

    // ========================================================================
    // UVM Build Phase
    // ========================================================================
    virtual function void build_phase(uvm_phase phase);
        super.build_phase(phase);

        m_monitor = binary_alu_monitor::type_id::create("m_monitor", this);

        if (get_is_active() == UVM_ACTIVE) begin
            m_driver    = binary_alu_driver::type_id::create("m_driver", this);
            m_sequencer = uvm_sequencer#(binary_alu_transaction)::type_id::create("m_sequencer", this);
        end
    endfunction

    // ========================================================================
    // UVM Connect Phase
    // ========================================================================
    virtual function void connect_phase(uvm_phase phase);
        if (get_is_active() == UVM_ACTIVE) begin
            m_driver.seq_item_port.connect(m_sequencer.seq_item_export);
        end
    endfunction

endclass : binary_alu_agent

`endif  // BINARY_ALU_AGENT_SV
